# 文件名: data_count
# 当前用户: shiping.zheng
# 当前日期: 2024/9/26
# 当前时间: 14:48
# 项目名称: Flag
"""
模块描述:
    
"""
import requests
from ck_connect import ClickHouseConnector

class ReSponseData:
    def all_request(self, method, url, headers, data,key):
        if method.lower() == 'get':
            response = requests.get(url, headers=headers, params=data)
        else:
            response = requests.request(method, url, headers=headers, json=data)
        if response.status_code == 200:
            data = response.json()
            status_info = data.get("data", {}).get("statusInfo", {})
            return status_info.get(key)
        else:
            print(f"请求失败，状态码: {response.status_code}")
            return None